package com.haohao.system.service.impl;

import java.util.List;
import com.haohao.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.haohao.system.mapper.SysOrdersMapper;
import com.haohao.system.domain.SysOrders;
import com.haohao.system.service.ISysOrdersService;

/**
 * 销售订单Service业务层处理
 * 
 * @author haohao
 * @date 2024-04-10
 */
@Service
public class SysOrdersServiceImpl implements ISysOrdersService 
{
    @Autowired
    private SysOrdersMapper sysOrdersMapper;

    /**
     * 查询销售订单
     * 
     * @param id 销售订单主键
     * @return 销售订单
     */
    @Override
    public SysOrders selectSysOrdersById(Long id)
    {
        return sysOrdersMapper.selectSysOrdersById(id);
    }

    /**
     * 查询销售订单列表
     * 
     * @param sysOrders 销售订单
     * @return 销售订单
     */
    @Override
    public List<SysOrders> selectSysOrdersList(SysOrders sysOrders)
    {
        return sysOrdersMapper.selectSysOrdersList(sysOrders);
    }

    /**
     * 新增销售订单
     * 
     * @param sysOrders 销售订单
     * @return 结果
     */
    @Override
    public int insertSysOrders(SysOrders sysOrders)
    {
        sysOrders.setCreateTime(DateUtils.getNowDate());
        return sysOrdersMapper.insertSysOrders(sysOrders);
    }

    /**
     * 修改销售订单
     * 
     * @param sysOrders 销售订单
     * @return 结果
     */
    @Override
    public int updateSysOrders(SysOrders sysOrders)
    {
        return sysOrdersMapper.updateSysOrders(sysOrders);
    }

    /**
     * 批量删除销售订单
     * 
     * @param ids 需要删除的销售订单主键
     * @return 结果
     */
    @Override
    public int deleteSysOrdersByIds(Long[] ids)
    {
        return sysOrdersMapper.deleteSysOrdersByIds(ids);
    }

    /**
     * 删除销售订单信息
     * 
     * @param id 销售订单主键
     * @return 结果
     */
    @Override
    public int deleteSysOrdersById(Long id)
    {
        return sysOrdersMapper.deleteSysOrdersById(id);
    }
}
